<?php 

require '.'.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR.'xtractor.inc.php';


$x = new xtractor($_POST['urlstring'], $_POST['htmlstring']);

if ($_POST['getlinks'] == 'true') {
	$links = $x->get_links();
	$link_count = count($links);
	
	echo "<h2>Found ".$link_count." links</h2>";
	echo "<ul>\n";
	foreach ($links as $v)
		echo "\t<li>$v</li>\n";
	echo "</ul>\n";
}
if ($_POST['getimages'] == 'true') {
	$images = $x->get_images();
	$image_count = count($images);
	
	echo "<h2>Found ".$image_count." links</h2>";
	echo "<ul>\n";
	foreach ($images as $v)
		echo "\t<li>$v</li>\n";
	echo "</ul>\n";
}
